home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
RTPC10
/
CLICK.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-11-20
|
3KB
|
69 lines
{
┌────────┬──────────────────────────────────────────────────────┐
│Name │ CLICK.PAS │
├────────┼──────────────────────────────────────────────────────┤
│Use │ Just an example program for TP6 and above. │
│ │ A TSR that clicks each time a key is pressed. │
├────────┼──────────────────────────────────────────────────────┤
│By │ Rafe Aldridge - (C) Copyright 1993 │
└────────┴──────────────────────────────────────────────────────┘
┌───────────────────────────────────────────────────────────────┐
│ Please realise that this program present's an idea. No claim │
│ is made that it is well written or cannot be improved upon │
└───────────────────────────────────────────────────────────────┘
┌───────────────────────────────────────────────────────────────┐
│ Rafe's TP Collection is SHAREWARE │
├───────────────────────────────────────────────────────────────┤
│ │
│ If you find any part of Rafe's TP Collection usefull then │
│ please become a registered user by sending 10 Pounds Sterling │
│ to the address below. In return you will recieve the LATEST │
│ FULL source code to ALL the units as well anything new. │
│ │
│ Please feel free to write with suggestions, ideas or money to │
│ Rafe Aldridge, │
│ Street Farm, │
│ Dereham Road, │
│ Garvestone, │
│ Norfolk. │
│ NR9 4QT │
│ ENGLAND │
│ │
└───────────────────────────────────────────────────────────────┘
}
{ ---------------------------------------------------------------------- }
{ NOTES: }
{ o A TP interrupt proc disables interrupts. Hence the need for an STI. }
{ o An interrupt proc must not last more than 50mS. If it will last }
{ longer then a busy flag must be used to stop recursion. }
{ o This program also demonstrates how to keep data in the code segment. }
{ ---------------------------------------------------------------------- }
{$M 1024,0,0} { reserve stack memory }
{R-,S-,D-,L-} { turn off stack checking etc. }
Uses CRT,DOS; { libraries for sound and for getintvec and setintvec }
Procedure KEY_VEC; Assembler; ASM; DB 0,0,0; End;
Procedure KEYBOARD; Interrupt;
Begin
Asm { use built in assmblr to call old key routine }
Pushf
Call DWord Ptr CS:[KEY_VEC]
End;
Sound (50); { do click sound using TP functions }
Delay (2);
NoSound;
Asm
STI; { enable interrupts as TP proc turned them off }
End;
End;
Begin
GetIntVec (9,Pointer(@KEY_VEC^)); { get old vector }
SetIntVec (9,@KEYBOARD); { point vector to our routine }
Keep(0);
End.